#ifndef TLS_LIGHT_H
#define TLS_LIGHT_H
#include "vector.h"
#include "triangle.h"
#include <cstdio>

namespace tls{
  struct light{
    //wi is normalized
    virtual vec3 L(const isect& hit,vec3& wi)const=0;
    virtual ~light();
  };

  struct point_light:public light{
    vec3 pos;
    vec3 intensity;
    point_light(const vec3& p=vec3(),const vec3& v=vec3()):
      pos(p),intensity(v){}
    ~point_light();

    //returned wi is NOT normalized
    vec3 L(const isect& hit,vec3& wi)const;
  };
  void* create_point_light(std::FILE* file);

}//namespace tls

#endif
